/**
* @desc 从sn判断设备型号
* */
export default function deviceType(sn) {
    if(!sn || typeof sn !== 'string' || sn.length < 9) {
        return {
            key: '',
            model: '未知'
        }
    }
    // 截取sn号的7、8位
    const X = sn.slice(6, 8).toUpperCase()
    let model = ''
    switch (X) {
        case 'OT':
            model = 'P系列'
            break
        case 'SP':
            model = 'X系列'
            break
        case 'DT':
            model = '原钉钉(MQTT)'
            break
        case 'DP':
            model = '新钉钉设备(websocket)'
            break
        case 'ST':
            model = 'S系列'
            break
        default:
            model = '未知'
    }
    return {
        key: X,
        model
    }
}
